//
//  HomeCell.swift
//  PhotoBrowser
//
//  Created by 林彬 on 16/4/28.
//  Copyright © 2016年 linbin. All rights reserved.
//

import UIKit

class HomeCell: UICollectionViewCell {
    
    @IBOutlet weak var imageView: UIImageView!
    
    // 有一个模型属性
    var shop : Shop?{
        didSet {
            
            // 先做空值校验.
            guard let urlStr = shop?.q_pic_url else{
                return
            }
            
            let url = NSURL(string: urlStr)!
            
            imageView.setImageWithURL(url, placeholderImage: UIImage(imageLiteral: "empty_picture"))
        }
    }
}
